package com.example.basic;

public class PriorityTest implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName());
            System.out.println(Thread.currentThread().getPriority());
        }
    }

    public static void main(String[] args) {
        PriorityTest priorityTest = new PriorityTest();
        Thread a = new Thread(priorityTest, "A");
        Thread b = new Thread(priorityTest, "B");
        a.start();
        b.start();
        a.setPriority(10);
        b.setPriority(1);
    }
}
